---
sidebar_label: Upgrading to config v2
sidebar_position: 5
description: Upgrade to Hasura Migrations v2
keywords:
  - hasura
  - docs
  - migration
  - metadata
---

# Upgrading to Hasura Migrations config v2

## What has changed?

In **config v1**, the PG schema Migrations and Hasura Metadata were both
handled using the same [migration files](/migrations-metadata-seeds/legacy-configs/config-v1/reference/migration-file-format.mdx)
which were in `yaml` format. In **config v2**, these are managed
separately in their own directories in the Hasura Project. Metadata is
managed in its separate [metadata directory](/migrations-metadata-seeds/legacy-configs/config-v2/reference/metadata-format.mdx) and PG
schema Migrations are managed via
[migration files](/migrations-metadata-seeds/legacy-configs/config-v2/reference/migration-file-format.mdx) that are now in `SQL`
format.

### Changes needed in existing workflows

Due to the above mentioned changes, any workflows that involve applying
Migrations have an additional step of applying Metadata as well.

For example,

- any place where the `hasura migrate apply` command is used, it now
  needs to be followed by a `hasura metadata apply` command.
- if the `cli-migrations` Docker image is used for
  [auto applying migrations](/migrations-metadata-seeds/auto-apply-migrations.mdx) at server start,
  now you will have to use the `cli-migrations-v2` image and the
  `/metadata` directory will also have to be mounted along with the
  `/migrations` directory

## Upgrade steps

### Step 1: Take a backup

Make sure you take a backup of your Hasura Project before upgrading to
`config v2`.

### Step 2: Upgrade to the latest CLI

Config v2 is available since `v1.2.0`.

Run:

```bash
hasura update-cli
```

### Step 3: Upgrade Hasura Project to v2

In your project directory, run:

```bash
hasura scripts update-project-v2
```

Your project directory and `config.yaml` should be updated to v2.
